package com.shhm.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.shhm.business.dto.request.EvaluationReq;
import com.shhm.business.dto.response.EvaluationResp;
import com.shhm.common.entity.common.EvaluationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author JackZ
 * @version 1.0
 * @description: TODO
 * @date 2025/9/14 下午11:11
 */
@Mapper
public interface EvaluationMapper extends BaseMapper<EvaluationEntity> {
    @Select("select te.*,su.nick_name,su.user_id as seller_id,tp.product_name from tb_evaluation as te LEFT JOIN tb_product as tp on te.product_num = tp.product_num\n" +
            "left join sys_user as su on su.user_id=tp.seller_id where tp.seller_id=#{userId}")
    List<EvaluationEntity> selectSellerEvaluation(Integer sellerId);

    List<EvaluationResp>  selectDetail(@Param("entity") EvaluationReq entity);

    PageDTO<EvaluationEntity> selectDetailWithPage(PageDTO<EvaluationEntity> evaluationEntityPageDTO, EvaluationReq entity);
}
